package com.cn.domain;

import java.io.Serializable;
import java.util.List;

/**
 * 购物车
 */
public class Cart implements Serializable{
	private static final long serialVersionUID = 1L;
	
	private long id;    //购物车ID
    private long pid;     //商品ID
    private long quantity;  //商品数量
    private long userid;       //用户ID
    
    private User user;//用户userid
    
    private Product product;//根据PID获取产品pid

    private Order order;//获取订单信息
    
    public Order getOrder() {
		return order;
	}

	public void setOrder(Order order) {
		this.order = order;
	}

	private List<Order> orderList;//订单外键
    
	public List<Order> getOrderList() {
		return orderList;
	}

	public void setOrderList(List<Order> orderList) {
		this.orderList = orderList;
	}
	
	public User getUser() {
		return user;
	}



	public void setUser(User user) {
		this.user = user;
	}



	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	
    public Cart() {
	}
    


	public Cart(long id, long pid, long quantity, long userid, Product product,User user) {
		this.id = id;
		this.user=user;
		this.pid = pid;
		this.quantity = quantity;
		this.userid = userid;
		this.product = product;
	}



	public Product getProduct() {
		return product;
	}


	public void setProduct(Product product) {
		this.product = product;
	}


	public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public long getPid() {
        return pid;
    }

    public void setPid(long pid) {
        this.pid = pid;
    }

    public long getQuantity() {
        return quantity;
    }

    public void setQuantity(long quantity) {
        this.quantity = quantity;
    }

    public long getUserid() {
        return userid;
    }

    public void setUserid(long userid) {
        this.userid = userid;
    }

    @Override
    public String toString() {
        return "Cart{" +
                "id=" + id +
                ", pid=" + pid +
                ", quantity=" + quantity +
                ", userid=" + userid +
                '}';
    }
}
